﻿using Microsoft.Extensions.DependencyInjection;

namespace sixgod.Model.Attribute
{
    /// <summary>
    /// 依赖注入特性
    /// </summary>
    public class DiAttribute:global::System.Attribute
    {
        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="type">接口类型</param>
        /// <param name="serviceLifetime">生命周期</param>
        public DiAttribute(Type type, ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
        {
            InterFaceType = type;
            ServiceLifetime = serviceLifetime;
        }

        public ServiceLifetime ServiceLifetime { get; set; }

        public Type InterFaceType { get; set; }
    }
}
